<!doctype html>






<html class="theme-next mist use-motion">
<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />












    <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>




    <link href="//fonts.useso.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">



    <link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

    <link href="/css/main.css?v=0.5.0" rel="stylesheet" type="text/css" />


    <meta name="keywords" content="根据字节码探讨java自增运算符的原理" />





    <link rel="alternate" href="/atom.xml" title="Vino" type="application/atom+xml" />




    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.5.0" />






    <meta name="description" content="根据字节码探讨java自增运算符的原理">
    <meta property="og:type" content="article">
    <meta property="og:title" content="根据字节码探讨java自增运算符的原理">
    <meta property="og:url" content="http://blog.vino.ren/blog/2016/05/java-code-++.html">
    <meta property="og:site_name" content="Vino">
    <meta property="og:description" content="根据字节码探讨java自增运算符的原理">
    <meta property="og:image" content="http://blog.vino.ren/images/apktool.png">
    <meta property="og:image" content="http://blog.vino.ren/images/apktool2.png">
    <meta property="og:image" content="http://blog.vino.ren/images/jdgui.png">
    <meta property="og:image" content="http://blog.vino.ren/images/classshark.png">
    <meta property="og:updated_time" content="2016-04-17T11:44:57.000Z">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="根据字节码探讨java自增运算符的原理">
    <meta name="twitter:description" content="根据字节码探讨java自增运算符的原理">



    <script type="text/javascript" id="hexo.configuration">
        var NexT = window.NexT || {};
        var CONFIG = {
            scheme: 'Mist',
            sidebar: {"position":"left","display":"post"},
            fancybox: true,
            motion: true,
            duoshuo: {
                userId: 0,
                author: '博主'
            }
        };
    </script>

    <title> 根据字节码探讨java自增运算符的原理 | Vino </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">





<script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?340874ba9357cbe81570aa4ac1185941";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>











<div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
        <div class="header-inner">
            <script>
                (function(){
                    var bp = document.createElement('script');
                    bp.src = '//push.zhanzhang.baidu.com/push.js';
                    var s = document.getElementsByTagName("script")[0];
                    s.parentNode.insertBefore(bp, s);
                })();
            </script>

            <div class="site-meta ">


                <div class="custom-logo-site-title">
                    <a href="/"  class="brand" rel="start">
                        <span class="logo-line-before"><i></i></span>
                        <span class="site-title">Vino</span>
                        <span class="logo-line-after"><i></i></span>
                    </a>
                </div>
                <p class="site-subtitle"></p>
            </div>

            <div class="site-nav-toggle">
                <button>
                    <span class="btn-bar"></span>
                    <span class="btn-bar"></span>
                    <span class="btn-bar"></span>
                </button>
            </div>

            <nav class="site-nav">



                <ul id="menu" class="menu menu-left">


                    <li class="menu-item menu-item-home">
                        <a href="/" rel="section">

                            <i class="menu-item-icon fa fa-home fa-fw"></i> <br />

                            首页
                        </a>
                    </li>


                    <li class="menu-item menu-item-categories">
                        <a href="/categories" rel="section">

                            <i class="menu-item-icon fa fa-th fa-fw"></i> <br />

                            分类
                        </a>
                    </li>


                    <li class="menu-item menu-item-archives">
                        <a href="/archives" rel="section">

                            <i class="menu-item-icon fa fa-archive fa-fw"></i> <br />

                            归档
                        </a>
                    </li>


                    <li class="menu-item menu-item-tags">
                        <a href="/tags" rel="section">

                            <i class="menu-item-icon fa fa-tags fa-fw"></i> <br />

                            标签
                        </a>
                    </li>


                    <li class="menu-item menu-item-about">
                        <a href="/about" rel="section">

                            <i class="menu-item-icon fa fa-user fa-fw"></i> <br />

                            关于
                        </a>
                    </li>





                </ul>



                <div class="site-search">

                    <form class="site-search-form">
                        <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
                    </form>

                    <script type="text/javascript">
                        (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
                                    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
                            e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
                        })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

                        _st('install', 'fLM9qfxyerC6njvM7usy','2.0.0');
                    </script>



                </div>

            </nav>

        </div>
    </header>

    <main id="main" class="main">
        <div class="main-inner">
            <div class="content-wrap">
                <div id="content" class="content">


                    <div id="posts" class="posts-expand">









                        <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">


                            <header class="post-header">



                                <h1 class="post-title" itemprop="name headline">



                                    根据字节码探讨java自增运算符的原理


                                </h1>


                                <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-04-17T18:16:21+08:00" content="2016-03-20">
                2016-04-17
            </time>
          </span>


            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>

                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index">
                      <span itemprop="name">java</span>
                  </a>
                </span>





            </span>




              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/blog/2016/05/java-code-++.html.html#comments" itemprop="discussionUrl">
                    <span class="post-comments-count ds-thread-count" data-thread-key="/blog/2016/05/java-code-++.html" itemprop="commentsCount"></span>
                </a>
              </span>








	<span id="busuanzi_container_page_pv" class="post-meta-item-text">
		&nbsp; | &nbsp;
	    <span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span> Hits
	</span>
                                </div>
                            </header>




                            <div class="post-body" itemprop="articleBody">
                                <figure class="highlight java">
                                    <table><tr><td class="gutter"><pre>
        <span class="line">1</span><br></pre></td>
                                        <td class="code"><pre><span class="line">public class Test {</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">2</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   static int x, y;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">3</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   public static void main(String args[]) {</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">4</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       x++;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">5</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       myMethod();</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">6</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       System.out.println(x + y + ++x);</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">7</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   }</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">8</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   public static void myMethod() {</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">9</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       y = x++ + ++x;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">10</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   }</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">11</span><br></pre></td>
                                            <td class="code"><pre><span class="line">}</span><br></pre></td></tr>
                                    </table></figure>





                                <p><strong>如果以上代码的结果你很自信能做对,那么本文或许对你帮助不大,但仍然可以看下java底层的实现.在最后将给出以上代码的结果以及解析.</strong></p>
                                <p>本文中的例子主要针对以下情况:</p>
                                <p>①x=y++</p>
                                <p>②x=++y</p>
                                <p>③x=x++</p>
                                <p>④x=++x</p>
                                <p>a:x,y为形参</p>
                                <p>b:x,y为成员变量</p>
                                <p>废话不多说,直接上代码</p>
                                <h3 id="分类1"><a href="#分类1" class="headerlink" title="分类1"></a><strong>代码1(①+b):</strong></h3>

                                <figure class="highlight java">
                                    <table><tr><td class="gutter"><pre>
        <span class="line">1</span><br></pre></td>
                                        <td class="code"><pre><span class="line">public class Test {</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">2</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   static int x, y;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">3</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   public static void main(String args[]) {</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">4</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       test();</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">5</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   }</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">6</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   public static void test(){</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">7</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       x = y++;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">8</span><br></pre></td>
                                            <td class="code"><pre><span class="line">       System.out.println(x+""+y);</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">9</span><br></pre></td>
                                            <td class="code"><pre><span class="line">   }</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">10</span><br></pre></td>
                                            <td class="code"><pre><span class="line">}</span><br></pre></td></tr>
                                    </table></figure>
                                <p>结果:01</p>
                                <p id="字节码"><a href="#字节码" class="headerlink" title="字节码"></a><strong>test()字节码:</strong></p>
                                <figure class="highlight java">
                                    <table><tr><td class="gutter"><pre>
        <span class="line">1</span><br></pre></td>
                                        <td class="code"><pre><span class="line">getstatic     #3                  // Field y:I</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">2</span><br></pre></td>
                                            <td class="code"><pre><span class="line">dup</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">3</span><br></pre></td>
                                            <td class="code"><pre><span class="line">iconst_1</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">4</span><br></pre></td>
                                            <td class="code"><pre><span class="line">iadd</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">5</span><br></pre></td>
                                            <td class="code"><pre><span class="line">putstatic     #3                  // Field y:I</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">6</span><br></pre></td>
                                            <td class="code"><pre><span class="line">putstatic     #4                  // Field x:I</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">7</span><br></pre></td>
                                            <td class="code"><pre><span class="line">getstatic     #5                  // Field java/lang/System.out:Ljava/io/PrintStream;</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">8</span><br></pre></td>
                                            <td class="code"><pre><span class="line">getstatic     #4                  // Field x:I</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">9</span><br></pre></td>
                                            <td class="code"><pre><span class="line">invokevirtual #6                  // Method java/io/PrintStream.println:(I)V</span><br></pre></td></tr>
                                        <tr><td class="gutter"><pre>
        <span class="line">10</span><br></pre></td>
                                            <td class="code"><pre><span class="line">return</span><br></pre></td></tr>
                                    </table></figure>
                                <p>解释:</p>
                                <p>0:y(值)入操作栈</p>
                                <p>3:得到y(值)的一个快照y'(值)</p>
                                <p>(个人认为相当于是将栈顶元素也就是y(值)复制了一份,然后将复制得到的y'(值)入操作栈,现在操作栈中有y(值)和y'(值))</p>
                                <p>4:常量1入操作栈</p>
                                <p>5:常量1和y'(值)弹出栈,进行加操作,并将结果s入栈</p>
                                <p>6:将结果s弹出栈,赋给y(变量)(此时y==1)</p>
                                <p>9:将y(值)弹出栈,赋给x(变量)(此时x==0)</p>
                                <p>因为y(值)入操作栈之后没有修改,所以x依旧是0,而y变成了1</p>
                                <p>&nbsp;</p>




                                <h3 id="使用方法"><a href="#使用方法" class="headerlink" title="使用方法"></a>使用方法</h3><p>使用方式：<br>1.反编译<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apktool d test.apk</span><br></pre></td></tr></table></figure></p>
                                <p>反编译后在home目录下生成了一个文件夹，内容如下：<br><img src="/images/apktool.png" alt=""></p>
                                <p>各个文件简单介绍如下：<br>apktool.yml: apk属性.<br>AndroidManifest.xml: 清单文件, 非二进制.<br>original: 原始数据, 应用的二进制清单和签名.<br>res: 资源文件.<br>smali: dex解析的代码.smali是dex虚拟机的解析格式,在 dex2jar中,也包含smali格式的转换.</p>
                                <p>打开AndroidManifest文件，内容如下：<br><img src="/images/apktool2.png" alt=""><br>可以看到app_name和app的图标：<br><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">android:icon="@drawable/icon_meetyou" android:label="@string/app_name"</span><br></pre></td></tr></table></figure></p>
                                <p>接下来我们修改res/values/strings.xml下app_name的内容，并替换app图标<br>2.重新打包成apk<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apktool b <span class="built_in">test</span></span><br></pre></td></tr></table></figure></p>
                                <p>打包后在dist文件夹下生成新的apk文件。</p>
                                <h2 id="dex2jar"><a href="#dex2jar" class="headerlink" title="dex2jar"></a>dex2jar</h2><p>dex2jar是dex转换为jar的工具，很多人不会看smali文件，还是看java类文件比较舒服，这个时候可以借助这个工具来转成java代码。<br>下载地址:<a href="https://github.com/pxb1988/dex2jar" target="_blank" rel="external">dex2jar</a></p>
                                <h3 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h3><p>从Apk中解压出class.dex，使用dex2jar进行源码解析，在当前目录生成classes.dex.dex2jar.jar。<br>转换过程中, 如果发生内存不够, 修改 d2j_invoke.sh 的虚拟机配置.</p>
                                <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -Xms512m -Xmx1024m -classpath <span class="string">"<span class="variable">$&#123;_classpath&#125;</span>"</span> <span class="string">"<span class="variable">$@</span>"</span></span><br></pre></td></tr></table></figure>
                                <p>接下来使用JD-GUI打开jar包，下载地址:<a href="http://jd.benow.ca/" target="_blank" rel="external">jd-gui</a><br>界面如下所示:<br><img src="/images/jdgui.png" alt=""></p>
                                <h2 id="其他工具"><a href="#其他工具" class="headerlink" title="其他工具"></a>其他工具</h2><h3 id="android-killer"><a href="#android-killer" class="headerlink" title="android killer"></a>android killer</h3><p>集成了上面几个工具，并添加了一些功能<br>下载地址：<a href="http://pan.baidu.com/s/1dEy0VVN" target="_blank" rel="external">androidkiller</a></p>
                                <h3 id="ClassyShark"><a href="#ClassyShark" class="headerlink" title="ClassyShark"></a>ClassyShark</h3><p>下载地址：<a href="https://github.com/google/android-classyshark" target="_blank" rel="external">github</a></p>
                                <p>ClassyShark是一款可以查看Android可执行文件的浏览工具，支持.dex, .aar, .so, .apk, .jar, .class, .xml 等文件格式，分析里面的内容包括classes.dex文件，包、方法数量、类、字符串、使用的NativeLibrary等。</p>
                                <h4 id="使用方法-1"><a href="#使用方法-1" class="headerlink" title="使用方法"></a>使用方法</h4><p>1.打开apk文件java -jar ClassyShark.jar -open <your_apk.apk><br>2.将生成的所有数据导出到文本文件里java -jar ClassyShark.jar -dump <binary_file><br>3.将指定类生成的文件导出到文本文件里java -jar ClassyShark.jar -dump <binary_file> <fully_qualified_class_name><br>4.打开ClassyShark，在GUI界面展示某特定的类<br>5.java -jar ClassyShark.jar -open <binary_file> <fully_qualified_class_name><br>6.检测APKjava -jar ClassyShark.jar -inspect <your_apk.apk><br>7.导出所有的字符串 java -jar ClassyShark.jar -stringdump <your_apk.apk></your_apk.apk></your_apk.apk></fully_qualified_class_name></binary_file></fully_qualified_class_name></binary_file></binary_file></your_apk.apk></p>
                                <p>和其他的工具不同，ClassyShark通过分析App的项目结构和引用库的信息，我们大致掌握了该项目的架构，一些开发中的经验和不足，拓宽下开发视野，发现一些好用的开源库，增强我们的武器，这些都是我们在开发中可以借鉴的东西。比如我们查看美团App的结构，看它使用了哪些开源库，界面如下所示：<br><img src="/images/classshark.png" alt=""></p>


                            </div>

                            <footer class="post-footer">

                                <div class="post-tags">

                                    <a href="/tags/java/" rel="tag">#java</a>

                                </div>



                                <div class="post-nav">
                                    <div class="post-nav-next post-nav-item">

                                        <a href="/blog/2016/02/jekyll-to-hexo.html" rel="next" title="Jekyll迁移到Hexo搭建个人博客">
                                            <i class="fa fa-chevron-left"></i> Jekyll迁移到Hexo搭建个人博客
                                        </a>

                                    </div>

                                    <div class="post-nav-prev post-nav-item">

                                        <a href="/blog/2016/03/android-apk-signing.html" rel="prev" title="Android APK签名详解">
                                            Android APK签名详解 <i class="fa fa-chevron-right"></i>
                                        </a>

                                    </div>
                                </div>




                            </footer>
                        </article>



                        <div class="post-spread">

                            <div class="ds-share flat" data-thread-key="/blog/2016/05/java-code-++.html"
                                 data-title="根据字节码探讨java自增运算符的原理"
                                 data-content=""
                                 data-url="http://blog.vino.ren/blog/2016/05/java-code-++.html">
                                <div class="ds-share-inline">
                                    <ul  class="ds-share-icons-16">

                                        <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
                                        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
                                        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
                                        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
                                        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

                                    </ul>
                                    <div class="ds-share-icons-more">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>


                </div>


                <p>热评文章</p>


                <div class="comments" id="comments">

                    <div class="ds-thread" data-thread-key="/blog/2016/05/java-code-++.html"
                         data-title="根据字节码探讨java自增运算符的原理" data-url="http://blog.vino.ren/blog/2016/05/java-code-++.html">
                    </div>

                </div>


            </div>



            <div class="sidebar-toggle">
                <div class="sidebar-toggle-line-wrap">
                    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
                    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
                    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
                </div>
            </div>

            <aside id="sidebar" class="sidebar">
                <div class="sidebar-inner">




                    <ul class="sidebar-nav motion-element">
                        <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
                            文章目录
                        </li>
                        <li class="sidebar-nav-overview" data-target="site-overview">
                            站点概览
                        </li>
                    </ul>


                    <section class="site-overview sidebar-panel  sidebar-panel-active ">
                        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
                            <img class="site-author-image" itemprop="image"
                                 src="/images/avatar.jpg"
                                 alt="Vino" />
                            <p class="site-author-name" itemprop="name">Vino</p>
                            <p class="site-description motion-element" itemprop="description">Life is more important</p>
                        </div>
                        <nav class="site-state motion-element">
                            <div class="site-state-item site-state-posts">
                                <a href="/archives">
                                    <span class="site-state-item-count">63</span>
                                    <span class="site-state-item-name">日志</span>
                                </a>
                            </div>


                            <div class="site-state-item site-state-categories">
                                <a href="/categories">
                                    <span class="site-state-item-count">22</span>
                                    <span class="site-state-item-name">分类</span>
                                </a>
                            </div>



                            <div class="site-state-item site-state-tags">
                                <a href="/tags">
                                    <span class="site-state-item-count">69</span>
                                    <span class="site-state-item-name">标签</span>
                                </a>
                            </div>


                        </nav>


                        <div class="feed-link motion-element">
                            <a href="/atom.xml" rel="alternate">
                                <i class="fa fa-rss"></i>
                                RSS
                            </a>
                        </div>


                        <div class="links-of-author motion-element">


              <span class="links-of-author-item">
                <a href="https://github.com/vinoZHU" target="_blank">

                    <i class="fa fa-github"></i> GitHub

                </a>
              </span>

              <span class="links-of-author-item">
                <a href="http://weibo.com/u/5489075324" target="_blank">

                    <i class="fa fa-weibo"></i> weibo

                </a>
              </span>

              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/vino-21-59" target="_blank">

                    <i class="fa fa-weibo"></i> zhihu

                </a>
              </span>


                        </div>




                        <div class="links-of-author motion-element">

                            <p class="site-author-name">友情链接</p>

              <span class="links-of-author-item">
                <a href="http://www.cnblogs.com/vinozly/" target="_blank">女朋友</a>
              </span>

              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/lippi-ouyang" target="_blank">友链出租</a>
              </span>


                        </div>

                    </section>


                    <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
                        <div class="post-toc-indicator-top post-toc-indicator">
                            <i class="fa fa-angle-double-up"></i>
                        </div>
                        <div class="post-toc">




                            <div class="post-toc-content">
                                <ol class="nav">
                                    <!--<li class="nav-item nav-level-2"><a class="nav-link" href="#分类1"><span class="nav-number">1.</span> <span class="nav-text">分类1</span></a>-->
                                    <!--</li>-->
                                    <li class="nav-item nav-level-2"><a class="nav-link" href="#分类1"><span class="nav-number">1.</span> <span class="nav-text">分类1</span></a>
                                        <ol class="nav-child">
                                            <li class="nav-item nav-level-3"><a class="nav-link" href="#字节码"><span class="nav-number">1.1.</span> <span class="nav-text">字节码</span></a>
                                            </li>
                                        </ol>
                                    </li>
                                    <li class="nav-item nav-level-2"><a class="nav-link" href="#Apktool"><span class="nav-number">2.</span> <span class="nav-text">Apktool</span></a>
                                        <ol class="nav-child">
                                            <li class="nav-item nav-level-3"><a class="nav-link" href="#Linux下安装教程："><span class="nav-number">2.1.</span> <span class="nav-text">Linux下安装教程：</span></a>
                                            </li>
                                            <li class="nav-item nav-level-3"><a class="nav-link" href="#使用方法"><span class="nav-number">2.2.</span> <span class="nav-text">使用方法</span></a>
                                            </li>
                                        </ol>
                                    </li>
                                    <li class="nav-item nav-level-2"><a class="nav-link" href="#dex2jar"><span class="nav-number">3.</span> <span class="nav-text">dex2jar</span></a>
                                        <ol class="nav-child">
                                            <li class="nav-item nav-level-3"><a class="nav-link" href="#使用"><span class="nav-number">3.1.</span> <span class="nav-text">使用</span></a>
                                            </li>
                                        </ol>
                                    </li>
                                    <li class="nav-item nav-level-2"><a class="nav-link" href="#其他工具"><span class="nav-number">4.</span> <span class="nav-text">其他工具</span></a>
                                        <ol class="nav-child">
                                            <li class="nav-item nav-level-3"><a class="nav-link" href="#android-killer"><span class="nav-number">4.1.</span> <span class="nav-text">android killer</span></a>
                                            </li><li class="nav-item nav-level-3"><a class="nav-link" href="#ClassyShark"><span class="nav-number">4.2.</span> <span class="nav-text">ClassyShark</span></a>
                                            <ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#使用方法-1"><span class="nav-number">4.2.1.</span> <span class="nav-text">使用方法</span></a>
                                            </li>
                                            </ol>
                                        </li>
                                        </ol>
                                    </li>
                                </ol>
                            </div>

                        </div>
                        <div class="post-toc-indicator-bottom post-toc-indicator">
                            <i class="fa fa-angle-double-down"></i>
                        </div>
                    </section>


                </div>
            </aside>



        </div>
    </main>

    <footer id="footer" class="footer">
        <div class="footer-inner">
            <div class="copyright" >

                &copy;  2014 -
                <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
                <span class="author" itemprop="copyrightHolder">Vino</span>
            </div>

            <div class="powered-by">
                由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动
            </div>

            <div class="theme-info">
                托管在 -
                <a class="theme-link" href="https://github.com/vinoZHU/vinoZHU.github.io">
                    Github
                </a>

            </div>
            <div class="theme-info">
<span id="busuanzi_container_site_pv">
    &nbsp; | &nbsp;本站总访问量<span id="busuanzi_value_site_pv"></span>次
</span>
            </div>
            <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
            </script>



        </div>
    </footer>

    <div class="back-to-top"></div>
</div>








<script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

<script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

<script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

<script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>

<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>

<script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>





<script type="text/javascript" src="/js/src/utils.js?v=0.5.0"></script>

<script type="text/javascript" src="/js/src/motion.js?v=0.5.0"></script>








<script type="text/javascript" src="/js/src/scrollspy.js?v=0.5.0"></script>

<script type="text/javascript" id="sidebar.toc.highlight">
    $(document).ready(function () {
        var tocSelector = '.post-toc';
        var $tocSelector = $(tocSelector);
        var activeCurrentSelector = '.active-current';

        $tocSelector
                .on('activate.bs.scrollspy', function () {
                    var $currentActiveElement = $(tocSelector + ' .active').last();

                    removeCurrentActiveClass();
                    $currentActiveElement.addClass('active-current');

                    $tocSelector[0].scrollTop = $currentActiveElement.position().top;
                })
                .on('clear.bs.scrollspy', function () {
                    removeCurrentActiveClass();
                });

        function removeCurrentActiveClass () {
            $(tocSelector + ' ' + activeCurrentSelector)
                    .removeClass(activeCurrentSelector.substring(1));
        }

        function processTOC () {
            getTOCMaxHeight();
            toggleTOCOverflowIndicators();
        }

        function getTOCMaxHeight () {
            var height = $('.sidebar').height() -
                    $tocSelector.position().top -
                    $('.post-toc-indicator-bottom').height();

            $tocSelector.css('height', height);

            return height;
        }

        function toggleTOCOverflowIndicators () {
            tocOverflowIndicator(
                    '.post-toc-indicator-top',
                    $tocSelector.scrollTop() > 0 ? 'show' : 'hide'
            );

            tocOverflowIndicator(
                    '.post-toc-indicator-bottom',
                    $tocSelector.scrollTop() >= $tocSelector.find('ol').height() - $tocSelector.height() ? 'hide' : 'show'
            )
        }

        $(document).on('sidebar.motion.complete', function () {
            processTOC();
        });

        $('body').scrollspy({ target: tocSelector });
        $(window).on('resize', function () {
            if ( $('.sidebar').hasClass('sidebar-active') ) {
                processTOC();
            }
        });

        onScroll($tocSelector);

        function onScroll (element) {
            element.on('mousewheel DOMMouseScroll', function (event) {
                var oe = event.originalEvent;
                var delta = oe.wheelDelta || -oe.detail;

                this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;
                event.preventDefault();

                toggleTOCOverflowIndicators();
            });
        }

        function tocOverflowIndicator (indicator, action) {
            var $indicator = $(indicator);
            var opacity = action === 'show' ? 1 : 0;
            $indicator.velocity ?
                    $indicator.velocity('stop').velocity({
                        opacity: opacity
                    }, { duration: 100 }) :
                    $indicator.stop().animate({
                        opacity: opacity
                    }, 100);
        }

    });
</script>

<script type="text/javascript" id="sidebar.nav">
    $(document).ready(function () {
        var html = $('html');
        var TAB_ANIMATE_DURATION = 200;
        var hasVelocity = $.isFunction(html.velocity);

        $('.sidebar-nav li').on('click', function () {
            var item = $(this);
            var activeTabClassName = 'sidebar-nav-active';
            var activePanelClassName = 'sidebar-panel-active';
            if (item.hasClass(activeTabClassName)) {
                return;
            }

            var currentTarget = $('.' + activePanelClassName);
            var target = $('.' + item.data('target'));

            hasVelocity ?
                    currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () {
                        target
                                .velocity('stop')
                                .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION)
                                .addClass(activePanelClassName);
                    }) :
                    currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () {
                        currentTarget.hide();
                        target
                                .stop()
                                .css({'opacity': 0, 'display': 'block'})
                                .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () {
                                    currentTarget.removeClass(activePanelClassName);
                                    target.addClass(activePanelClassName);
                                });
                    });

            item.siblings().removeClass(activeTabClassName);
            item.addClass(activeTabClassName);
        });

        $('.post-toc a').on('click', function (e) {
            e.preventDefault();
            var targetSelector = NexT.utils.escapeSelector(this.getAttribute('href'));
            var offset = $(targetSelector).offset().top;
            hasVelocity ?
                    html.velocity('stop').velocity('scroll', {
                        offset: offset  + 'px',
                        mobileHA: false
                    }) :
                    $('html, body').stop().animate({
                        scrollTop: offset
                    }, 500);
        });

        // Expand sidebar on post detail page by default, when post has a toc.
        NexT.motion.middleWares.sidebar = function () {
            var $tocContent = $('.post-toc-content');

            if (CONFIG.sidebar.display === 'post' || CONFIG.sidebar.display === 'always') {
                if ($tocContent.length > 0 && $tocContent.html().trim().length > 0) {
                    NexT.utils.displaySidebar();
                }
            }
        };
    });
</script>






<script type="text/javascript" src="/js/src/bootstrap.js?v=0.5.0"></script>









<script type="text/javascript">
    var duoshuoQuery = {short_name:"vinozly"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.id = 'duoshuo-script';
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0]
        || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
</script>
















</body>
</html>
